import { Pool } from "./Pool";

export default {
    start(this: Pool<any>) {
        // 确保不会超出资源数量
        this.waitingQueue.splice(0, this.resources.size).forEach((resolve) => {
            if (resolve instanceof Function) {
                resolve(this._Waiting());
            }
        });
    },
    release(this: Pool<any>) {
        const resolve = this.waitingQueue.shift();
        if (resolve instanceof Function) {
            resolve(this._Waiting());
        }
    },
    // acquire() {},
    // allRelease(){},
    // clear(){}
    // drain(){}
    // stop(){}
};
